llvm_map_components_to_libnames(llvm_libs ${LLVM_TARGETS_TO_BUILD}
        Analysis
        CodeGen
        Core
#        IPO
#        AggressiveInstCombine
#        InstCombine
#        Instrumentation
#        MC
#        MCParser
#        ObjCARCOpts
#        Option
#        ScalarOpts
        Support
#        TransformUtils
#        Vectorize
)

add_executable(iriscc
        Driver.cpp
)


target_include_directories(iriscc PRIVATE "${CMAKE_BINARY_DIR}/lib/IRGenerator")

find_package(MLIR REQUIRED CONFIG)
target_include_directories(iriscc PRIVATE ${MLIR_INCLUDE_DIRS})

target_link_libraries(iriscc
        PRIVATE
        IrisCCIRGenerator
        ASTVisitor
        CodeGen
        Implemented
        IRISPass
        MLIR
)
target_compile_options(iriscc PRIVATE "-fno-rtti")